package org.example.comp_algorithm_back.controller;

import org.example.comp_algorithm_back.common.CommonResponse;
import org.example.comp_algorithm_back.service.WordFrequencyService;
import org.example.comp_algorithm_back.vo.WordNumVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
public class WordFrequencyController {

    @Autowired
    private WordFrequencyService wordFrequencyService;
    @GetMapping("/getWordFrequency")
    public CommonResponse<ArrayList<WordNumVo>> getWordFrequency(@RequestParam int num) {
        return wordFrequencyService.getAndSaveWordFrequency(num);
    }
}
